package service;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.*;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@Component
@Aspect
@Order(3)
public class SecurityAspect {


    @Pointcut("execution(* service.UserService.*(..))")
    public void 通用切点(){

    }
    @Before("通用切点()")
    public void before(){
        System.out.println("before:security");
    }

    @AfterReturning("通用切点()")
    public void afterReturning(){
        System.out.println("afterReturning");
    }

    @Around("通用切点()")
    public void around(ProceedingJoinPoint joinPoint) throws Throwable {
        System.out.println("前置环绕");

        joinPoint.proceed();
        System.out.println("后置环绕");
    }

    @After("通用切点()")
    public void after(){
        System.out.println("最终通知");
    }
}
